package com.currentcms.client;

import com.currentcms.client.service.GreetingService;
import com.currentcms.client.service.GreetingServiceAsync;
import com.currentcms.shared.model.DataProperty;
import com.currentcms.shared.model.DataType;
import com.currentcms.shared.model.Role;
import com.currentcms.shared.model.Schema;
import com.currentcms.shared.model.Site;
import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.core.client.GWT;
import com.google.gwt.user.client.ui.RootPanel;


public class CMS6 implements EntryPoint {
	
	public void onModuleLoad() {
		System.out.println("HEYha");
	    
	    Site site = new Site();
	    Role admin = site.addRole("admin");
	    Role editor = site.addRole("editor");
	    Role contributor = site.addRole("contributor");
	    site.addUser("david@posttool.com", "pw", admin);
	    site.addUser("duke@posttool.com", "pw", editor);
	    site.addUser("dada@posttool.com", "pw", contributor);
	    
	    Schema schema = new Schema();
	    DataType book = new DataType();
	    book.addProperty("title", DataProperty.TYPE_STRING);
	    book.addProperty("description", DataProperty.TYPE_STRING);
	    book.addProperty("published", DataProperty.TYPE_DATE);
	    book.addReference("author", "Book");
	    schema.addDataType(book);
		
	    site.setSchema(schema);
	    
	    RootPanel rp = RootPanel.get();
	    //rp.add(new CMSApp());
		
	}
}
